webpackJsonp([16],{

/***/ 0:
/***/ function(module, exports, __webpack_require__) {

	var url = __webpack_require__(10);
	var template = __webpack_require__(11);
	var main = __webpack_require__(13);
	var form = __webpack_require__(20);
	var module = __webpack_require__(21);

	//模板配置
	var tplArr = [];
	var modalTpl = __webpack_require__(18);
	var personalTpl = __webpack_require__(24);
	var indexTpl = __webpack_require__(34);
	tplArr['modal'] = template.compile(modalTpl.replace(/^\s*|\s*$/g, ""));
	tplArr['personal'] = template.compile(personalTpl.replace(/^\s*|\s*$/g, ""));
	tplArr['index'] = template.compile(indexTpl.replace(/^\s*|\s*$/g, ""));

	var Ztype = main.GetQueryString('type');
	function Index() {
	    _this = this;
	    this.main = function () {
	        main.event(this, 'tap', 'i-click');
	        this.init();
	    };

	    /**
	     * @param  {string} page "come from which page"
	     * 个人中心首页
	     */
	    this.getContent = function (page) {
	        var baseUrl = _this.baseUrl;
	        var data = {
	            tType: "content"
	        };
	        var data_body = {
	            tType: "contentbody"
	        };
	        var data1 = { "list": [{ "name": "门店数", "key": "10" }, { "name": "累计销售额", "key": "1000.00" }, { "name": "累计佣金额", "key": "0" }] };
	        //个人信息
	        var data_headblock = {
	            tType: "headblock",
	            image: "",
	            title: "Golan Yao",
	            tag: "虚拟店员",
	            content: [{
	                key: "加盟商编号",
	                value: "123"
	            }],
	            qrcode: "http://placeholder.qiniudn.com/300x300",
	            qrlink: "",
	            qrdetail: "扫码成为专享粉丝，享受粉丝福利！"
	        };
	        //申请加入说明
	        var data_partner = {
	            tType: "partner",
	            title: "恭喜您！您已成为【超级粉丝】有机会成为【虚拟店员】",
	            description: "虚拟店员可获得虚拟店员专享二维码，享有8折拿货。",
	            link: "",
	            name: "微商申请流程"
	        };
	        //超链接列表
	        var data_arrlist = {
	            tType: "arrlist",
	            dataList: [{
	                name: "买家中心",
	                link: ""
	            }, {
	                name: "卖家中心",
	                click: "getContentBody," + page
	            }]
	        };
	        main.post(url.clerOpenidkSingle, {}, function (res) {
	            var ret = res.data;
	            console.log(ret);

	            data_headblock.title = ret.clerk_name;
	            data_headblock.content[0].value = ret.clerk_number;
	            data_headblock.qrcode = ret.ercode_url;
	            if (ret.status == 1) {
	                data1.list[0].key = ret.store_number;
	                data1.list[1].key = ret.countprice;
	                data1.list[2].key = ret.counts;
	            }

	            switch (page) {
	                case "storepartner":
	                    //门店合伙人
	                    data_headblock.tag = "门店合伙人";
	                    data_headblock.qrdetail = "";
	                    data_partner.title = "恭喜您！您满足条件，有机会申请成为【管理合伙人】";
	                    data_partner.description = "管理合伙人可获得品牌大使专享二维码，享有65折拿货。";
	                    data.headblock = module.getModule(data_headblock, "headblock");
	                    // data.account= tplArr['personal'](data_account);
	                    data_body.arrlist = module.getModule(data_arrlist, "arrlist");
	                    data_body.partner = module.getModule(data_partner, "partner");
	                    break;

	                case "clerkmember":
	                    //店员
	                    data_headblock.tag = "普通店员";
	                    data_headblock.qrdetail = "";
	                    data.headblock = module.getModule(data_headblock, "headblock");
	                    data_body.arrlist = module.getModule(data_arrlist, "arrlist");
	                    break;

	                case "clerkmaster":
	                    //店长
	                    data_headblock.tag = "店长";
	                    data_headblock.qrdetail = "";
	                    data.headblock = module.getModule(data_headblock, "headblock");
	                    data_body.arrlist = module.getModule(data_arrlist, "arrlist");
	                    break;

	                case "alliance":
	                    //加盟商
	                    data_headblock.tag = "";
	                    data_headblock.qrdetail = "";
	                    data.headblock = module.getModule(data_headblock, "headblock");
	                    data.triple = module.getModule(data1, "InfoTiled");
	                    data_body.arrlist = module.getModule(data_arrlist, "arrlist");
	                    break;

	            }
	            $(".content").html(tplArr['index'](data));
	            $(".content-body").empty().append(tplArr['index'](data_body));
	        });
	    };
	    //卖家中心
	    this.getContentBody = function (ths, page) {
	        var baseUrl = _this.baseUrl;
	        var data_body = {
	            tType: "contentbody"
	        };
	        //积分
	        var data_account = {
	            tType: "account",
	            key: "当前积分",
	            val: "1200",
	            name: "去积分商城"
	        };
	        //超链接列表
	        var data_arrlist = {
	            tType: "arrlist",
	            dataList: [{
	                name: "订单管理",
	                link: ""
	            }, {
	                name: "粉丝订单",
	                link: ""
	            }, {
	                name: "我的佣金",
	                link: ""
	            }]
	        };
	        //申请加入说明
	        var data_partner = {
	            tType: "partner",
	            title: "恭喜您！您满足条件，有机会申请成为【管理合伙人】",
	            description: "管理合伙人可获得品牌大使专享二维码，享有65折拿货。",
	            link: "",
	            name: "微商申请流程"
	        };
	        //我的订单
	        var data_tabblock = {
	            tType: "tabblock",
	            title: "我的订单",
	            baseUrl: baseUrl,
	            dataList: [{
	                image: _this.baseUrl + "order_1.jpg",
	                name: "全部订单",
	                click: "",
	                cornernum: ""
	            }, {
	                image: _this.baseUrl + "order_2.jpg",
	                name: "待付款",
	                click: "",
	                cornernum: ""
	            }, {
	                image: _this.baseUrl + "order_3.jpg",
	                name: "代收货",
	                click: "",
	                cornernum: ""
	            }, {
	                image: _this.baseUrl + "order_4.jpg",
	                name: "待评价",
	                click: "",
	                cornernum: ""
	            }, {
	                image: _this.baseUrl + "order_5.jpg",
	                name: "退换货",
	                click: "",
	                cornernum: ""
	            }]
	        };
	        main.post(url.clerOpenidkSingle, {}, function (res) {
	            var ret = res.data;
	            data_account.val = ret.integral;
	            switch (page) {
	                case "storepartner":
	                    //门店合伙人
	                    data_body.account = module.getModule(data_account, "account");
	                    data_body.arrlist = module.getModule(data_arrlist, "arrlist");
	                    data_body.partner = module.getModule(data_partner, "partner");
	                    break;

	                case "clerkmember":
	                    //店员          
	                    data_body.account = module.getModule(data_account, "account");
	                    data_body.arrlist = module.getModule(data_arrlist, "arrlist");
	                    break;

	                case "clerkmaster":
	                    //店长
	                    data_body.arrlist = module.getModule(data_arrlist, "arrlist");
	                    break;

	                case "alliance":
	                    data_arrlist = {
	                        tType: "arrlist",
	                        dataList: [{
	                            name: "店员身份审核",
	                            link: ""
	                        }, {
	                            name: "门店身份审核",
	                            link: ""
	                        }, {
	                            name: "粉丝迁移设置",
	                            link: ""
	                        }]
	                    };
	                    //我的操作
	                    var data_tabblock = {
	                        tType: "tabblock",
	                        title: "我的订单",
	                        baseUrl: baseUrl,
	                        dataList: [{
	                            image: _this.baseUrl + "order_1.jpg",
	                            name: "全部订单",
	                            click: "jump1",
	                            cornernum: ""
	                        }, {
	                            image: _this.baseUrl + "order_2.jpg",
	                            name: "待付款",
	                            click: "jump2",
	                            cornernum: ""
	                        }, {
	                            image: _this.baseUrl + "order_3.jpg",
	                            name: "代收货",
	                            click: "jump3",
	                            cornernum: ""
	                        }, {
	                            image: _this.baseUrl + "order_4.jpg",
	                            name: "待评价",
	                            click: "jump4",
	                            cornernum: ""
	                        }, {
	                            image: _this.baseUrl + "order_5.jpg",
	                            name: "退换货",
	                            click: "jump5",
	                            cornernum: ""
	                        }]
	                    };
	                    //加盟商              
	                    data_body.tabblock = module.getModule(data_tabblock, "tabblock");
	                    data_body.arrlist = module.getModule(data_arrlist, "arrlist");
	            }
	            $(".content-body").empty().append(tplArr['index'](data_body));
	        });
	    };
	    console.log(Ztype);
	    this.jump1 = function () {
	        window.location.href = url.orderManager + '?type=' + Ztype;
	    };
	    this.jump2 = function () {
	        window.location.href = url.orderManager + '?type=' + Ztype + '&order_status=pay_0';
	    };
	    this.jump3 = function () {
	        window.location.href = url.orderManager + '?type=' + Ztype + '&order_status=shipping_1';
	    };
	    this.jump4 = function () {
	        window.location.href = url.orderManager + '?type=' + Ztype + '&order_status=assess_1';
	    };
	    this.jump5 = function () {
	        window.location.href = url.orderManager + '?type=' + Ztype + '&order_status=return_4';
	    };
	    //inital page
	    this.init = function () {
	        this.page = _page;
	        this.baseUrl = url.baseImageUrl;
	        this.getContent(this.page);
	    };
	    return this.main();
	};

	var index = new Index();

/***/ },

/***/ 20:
/***/ function(module, exports, __webpack_require__) {

	var url = __webpack_require__(10);
	var template = __webpack_require__(12);
	var main = __webpack_require__(13);
	var modalTpl = __webpack_require__(18);

	//模板配置
	var tplArr = [];
	template.config('escape', false);
	tplArr['modal'] = template.compile(modalTpl.replace(/^\s*|\s*$/g, ""));

	//获取验证码
	function getCode(_dom, url, id) {
	  var _mobile = $('input[name="mobile"]').val();
	  var code = $('input[name="code"]').val();
	  if (_dom.text() != '获取验证码') {
	    return false;
	  }
	  if (_mobile == "") {
	    jsAlert('请输入手机号码');
	  } else if (/^1[3|4|5|7|8]\d{9}$/.test(_mobile) == false) {
	    jsAlert('手机号码格式有误');
	  } else {
	    _dom.text("校验中");
	    $.post(url, { "user_id": id, "mobile": _mobile }, function (json, textStatus) {
	      _json = json;
	      if (_json.code == 1) {
	        var tm = 60;
	        var tmr = setInterval(function () {
	          tm--;
	          if (tm > 0) {
	            _dom.text(tm + "秒");
	          } else {
	            _dom.text('获取验证码');
	            clearInterval(tmr);
	            tm = 60;
	            //_dom.attr('onclick','join.getCode()')
	          }
	        }, 1000);

	        jsAlert('验证码已发送');
	      } else if (_json.code == 2) {
	        jsAlert(_json.data);
	        _dom.text('获取验证码');
	      } else if (_json.code == 200) {
	        jsAlert(_json.data);
	        _dom.text('获取验证码');
	      }
	    }, 'json');
	  }
	}
	//弹窗
	function jsAlert(text, Fun) {
	  if (!Fun) {
	    Fun = 'm-click="modalAlertClose"';
	  }
	  var data = {
	    "type": "1",
	    "ico": 'warn',
	    "text": text,
	    "Callback": Fun
	  };
	  $('body').append(tplArr['modal'](data));
	}
	//表单数据整理
	// function ajaxSubmit_o(obj,module,but) {

	//   //var url = $(obj).attr("action") || window.location.href;
	//   var callback_name = $(obj).attr("callback");
	//   var url = $(obj).attr("action");
	//   var data = {};
	//   var ipts = {};
	//   $('input[name],textarea[name],select[name]',obj).each(function(item){
	//       var name = $(this).attr('name');
	//       var value = $(this).val();
	//       var ipt = $(this).attr('ipt');
	//       var isArray = /\[\]$/;
	//       if(isArray.test(name)){
	//           if(!data[name]){data[name]=[]}
	//           if(!ipts[name]){ipts[name]=[]}
	//           data[name].push(value);
	//           ipts[name].push(value,ipt);
	//       }else{
	//           data[name] = value;
	//           ipts[name] = [value,ipt];
	//       }
	//   });

	//   if(!yzForm(ipts)){return false;}
	//   but.attr('isSubmit','false').text('提交中...');
	//   $.ajax({
	//       url: url,
	//       type: "get",
	//       data: data,
	//       dataType: "json",
	//       success: function(ret){
	//           //if(ret.sms_success == "1"){
	//               //if(isNotEmpty(callback)) {
	//                 //_this.id = ret.success_id;
	//                 //jsConfirm('提示','请您确认所有填写的信息准确无误！',callback_name);
	//                 module[callback_name](ret);
	//               //}
	//           //}else if(ret.sms_success == "0"){
	//               //jsAlert("验证码错误");
	//           //}
	//       },
	//       error:function(ret){

	//       }
	//   });
	// }
	//表单数据整理
	function ajaxSubmit(obj, module, but) {
	  //console.info(module)
	  var but_val = but.html();
	  if (but_val == "提交中...") {
	    console.info("频次太快");
	    return false;
	  }
	  //var url = $(obj).attr("action") || window.location.href;
	  var callback_name = $(obj).attr("callback");
	  var url = $(obj).attr("action");
	  var formtype = $(obj).attr("f-type");
	  var data = {};
	  var ipts = {};
	  $('input[name],textarea[name],select[name]', obj).each(function (item) {
	    var name = $(this).attr('name');
	    var value = $(this).val();
	    var ipt = $(this).attr('ipt');
	    var isArray = /\[\]$/;
	    if (isArray.test(name)) {
	      if (!data[name]) {
	        data[name] = [];
	      }
	      if (!ipts[name]) {
	        ipts[name] = [];
	      }
	      data[name].push(value);
	      ipts[name].push(value, ipt);
	    } else {
	      data[name] = value;
	      ipts[name] = [value, ipt];
	    }
	  });

	  if ($("input[name='is_default']:checked").length == 1) {
	    data.is_default = 1;
	  } else {
	    data.is_default = 0;
	  }

	  if (!yzForm(ipts)) {
	    return false;
	  }
	  but.attr('isSubmit', 'false').html('提交中...');

	  //console.info(data)
	  data.openid = openid;
	  // $("body").html(data.serverId);
	  $.ajax({
	    url: url, //+"?openid_test=ojtKJjq93sF3dOoz4lA12MrxtcUk",
	    type: "post",
	    data: data,
	    dataType: "json",
	    success: function (ret) {
	      // console.info(ret)
	      //if(ret.sms_success == "1"){
	      //if(isNotEmpty(callback)) {
	      //_this.id = ret.success_id;
	      //jsConfirm('提示','请您确认所有填写的信息准确无误！',callback_name);
	      module[callback_name](ret);
	      but.html(but_val);
	      //}
	      //}else if(ret.sms_success == "0"){
	      //jsAlert("验证码错误");
	      //}
	    },
	    error: function (ret) {
	      but.html(but_val);
	      console.info(ret);
	    }
	  });
	}
	//方法验证
	function yzForm(data) {
	  var Ctrue = true;
	  var hour = $('select[name="sendplan_hour"]').val();
	  for (ipt in data) {
	    if (data[ipt][1] == 'true') {
	      continue;
	    }
	    switch (ipt) {

	      case 'name':
	        if (data[ipt][0] == "") {
	          isCtrue('请输入名字');return false;
	        }
	        break;

	      case 'mobile':
	        if (data[ipt][0] == "") {
	          isCtrue('请输入手机号码');return false;
	        } else if (/^1[3|4|5|7|8]\d{9}$/.test(data[ipt][0]) == false) {
	          isCtrue('手机号码格式有误');return false;
	        }
	        break;

	      case 'address':
	        if (data[ipt][0] == "") {
	          isCtrue('请输入详细地址');return false;
	        }
	        break;
	      case 'shipping_id':
	        if (data[ipt][0] == "") {
	          isCtrue('请选择物流');return false;
	        }
	        break;
	      case 'shipping_number':
	        if (data[ipt][0] == "") {
	          isCtrue('请填写物流单号');return false;
	        }
	        break;

	      // case 'is_default':
	      //    if(data[ipt][0]==""){isCtrue('请选择');return false;}
	      // break;
	    }
	  }
	  function isCtrue(text) {
	    Ctrue = false;
	    main.alert({
	      "title": "提示",
	      "content": text
	    });
	  };
	  return Ctrue;
	}

	exports.getCode = getCode;
	exports.jsAlert = jsAlert;
	exports.ajaxSubmit = ajaxSubmit;
	exports.yzForm = yzForm;

/***/ },

/***/ 24:
/***/ function(module, exports) {

	module.exports = "{{if tType== \"content\"}}\n<!-- 模块：id -->\n<div class=\"ui-container content\">\n\t{{if !!headgrid}}\n\t\t{{headgrid}}\n\t{{/if}}\n\n\t{{if !!tabblock}}\n\t\t{{tabblock}}\n\t{{/if}}\n\n\t{{if !!account}}\n\t\t{{account}}\n\t{{/if}}\n\n\t{{if !!arrlist}}\n\t\t{{arrlist}}\n\t{{/if}}\n\n\t{{if !!partner}}\n\t\t{{partner}}\n\t{{/if}}\n\n\t{{if !!btnName}}\n\t<div class=\"ui-btn-wrap\">        \n\t\t<a href=\"javascript:;\" {{btnClick}} class=\"ui-btn-pink ui-btn-lg\">{{btnName}}</a>\n    </div>\n\t{{/if}}\n</div>\n{{/if}}\n"

/***/ },

/***/ 34:
/***/ function(module, exports) {

	module.exports = "{{if tType== \"content\"}}\n<!-- 模块：id -->\n<div class=\"ui-container content\">\n\t{{if !!headblock}}\n\t\t{{headblock}}\n\t{{/if}}\n\t{{if !!triple}}\n\t\t{{triple}}\n\t{{/if}}\n\t<div class=\"content-body\">\n\t\t{{if !!contentbody}}\n\t\t\t{{contentbody}}\n\t\t{{/if}}\n\t</div>\n</div>\n{{/if}}\n\n{{if tType== \"contentbody\"}}\n\t{{if !!tabblock}}\n\t\t{{tabblock}}\n\t{{/if}}\n\n\t{{if !!account}}\n\t\t{{account}}\n\t{{/if}}\n\n\t{{if !!arrlist}}\n\t\t{{arrlist}}\n\t{{/if}}\n\n\t{{if !!partner}}\n\t\t{{partner}}\n\t{{/if}}\n\n\t{{if !!btnName}}\n\t<div class=\"ui-btn-wrap\">        \n\t\t<a href=\"javascript:;\" i-click=\"{{btnClick}}\" class=\"ui-btn-pink ui-btn-lg\">{{btnName}}</a>\n    </div>\n\t{{/if}}\n{{/if}}\n\n"

/***/ }

});